//
//  BookReadVC.m
//  LiteraryTune
//
//  Created by 陈雪丹 on 2018/5/20.
//  Copyright © 2018年 cxd. All rights reserved.
//

#import "BookReadVC.h"

@interface BookReadVC ()

@property (nonatomic, strong)UIWebView *myWebView;


@end

@implementation BookReadVC

#warning 阅读页面
#pragma mark --阅读页面

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self buildUI];
    _myWebView.backgroundColor = [UIColor whiteColor];
    NSURL *filePath = [NSURL URLWithString:_pdfUrl];
    NSURLRequest *request = [NSURLRequest requestWithURL: filePath];
    [_myWebView loadRequest:request];
    //使文档的显示范围适合UIWebView的bounds
    [_myWebView setScalesPageToFit:YES];
}

- (void)buildUI {
    [self.view addSubview:self.myWebView];
    
}

#pragma mark - 懒加载
- (UIWebView *)myWebView {
    if (!_myWebView) {
        _myWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - CXDTopHeight)];
    }
    return _myWebView;
}
@end
